;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;  SED13A3 LCD Controller 
;  script file for PalmDebugger

;  This file should have any useful macros for the debugger.
;  Examples of this are structures for the register maps in 
;  the processors, the globals, and other data formats.

;  History
;  2001-11-27	dia		Created
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;



;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; These MPW script lines will do most of the work of converting
;   a C Structure type to Debugger format
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;find 
;replace  -c  /([A-Za-z]+)2[ t]+([_a-zA-Z0-9[]-]+)1;/ "> 2 "1""
;find 
;replace -c  //// ""

; This may be helpful in visual studio...
;	^	\([^ /]*[	 ][	 ]*\)\([_A-Za-z0-9][_A-Za-z0-9]*\)
;		> \1"\2"
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; SED13A3 LCD Controller Definitions
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
typedef struct "Sed13A3DisplayRegsType"
	> UInt32	"productInformation"; 				

	> UInt8		"unused040506"[3] \- ;					
	> UInt8		"memoryClockConfig";					

	> UInt8		"unused08090A"[3] \- ;					
	> UInt8		"pixelClockConfig";					

	> UInt8		"unused0C"[1] \- ;						
	> UInt8		"modRate";							
	> UInt8		"unused0E"[1] \- ;						
	> UInt8		"panelType";							

	> UInt16	"displaySettings";					
	> UInt8		"unused12"[1] \- ;						
	> UInt8		"bitsPerPixel";						

	> UInt8		"unused141516"[3] \- ;					
	> UInt8		"powerSaveConfig";					


	> UInt32	"lookupTableWrite";					
	> UInt32	"lookupTableRead"; 					


	> UInt8		"unused202122"[3] \- ;					
	> UInt8		"horzTotal"; 							

	> UInt8		"unused242526"[3] \- ;					
	> UInt8		"horzDispPeriod";						

	> UInt8		"unused2829"[2] \- ;						
	> UInt16	"horzDispPeriodStart";				

	> UInt32	"fpLineStartPulse";					

	> UInt8		"unused3031"[2] \- ;						
	> UInt16	"vertTotal"; 							

	> UInt8		"unused3435"[2] \- ;						
	> UInt16	"vertDispPeriod";						

	> UInt8		"unused3839"[2] \- ;						
	> UInt16	"vertDispPeriodStart";				

	> UInt32	"fpFrameStartPulse";					

	> UInt32	"dispStartAddress";					

	> UInt8		"unused4445"[2] \- ;						
	> UInt16	"lineAddressOffset";					

	> UInt32	"unused484C"[2] \- ;						

	> UInt32	"piPDispStartAddress";				

	> UInt8		"unused5455"[2] \- ;						
	> UInt16	"piPLineAddressOffset";				

	> UInt16	"piPXEndPosition";					
	> UInt16	"piPXStartPosition";					
	> UInt16	"piPYEndPosition";					
	> UInt16	"piPYStartPosition";					

	> UInt8		"unused606162"[3] \- ;					
	> UInt8		"specialPurpose";						

	> UInt8		"select";						
	> UInt8		"direction";					
	> UInt8		"unused66"[1] \- ;					
	> UInt8		"data";						


	> UInt32	"unused686C"[2] \- ;						

	> UInt8		"unused707172"[3] \- ;					
	> UInt8		"pwmConfig"; 							
	> UInt8		"unused747576"[3] \- ;					
	> UInt8		"pwmDutyCycle"; 						

	> UInt32	"unused787C"[2] \- ;						

	> UInt32	"scratchPadA";						
	> UInt32	"scratchPadB";						
	> UInt32	"scratchPadC";						

	> UInt32    "unused8C_7FFC"[#8157] \-
	> UInt32    "R8000_BltControl"
	> UInt32    "R8004_BltStatus"
	> UInt32    "R8008_BltCommand"
	> UInt32    "R800C_BltSrcStart"
	> UInt32    "R8010_BltDestStart"
	> UInt32    "R8014_BltMemOffset"
	> UInt32    "R8018_BltWidth"
	> UInt32    "R801C_BltHeight"
	> UInt32    "R8020_BgColor"
	> UInt32    "R8024_FgColor"
	typeend

alias "A3Display" "dm 08000000 Sed13A3DisplayRegsType"
alias "a3lcd" "dm 08000000 Sed13A3DisplayRegsType"


typedef struct "Sed13A3UsbRegsType"
 > UInt16    "U00_Control"
 > UInt16    "U02_IntEnable0"
 > UInt16    "U04_IntStatus0"
 > UInt16    "U06_IntEnable1"
 > UInt16    "U08_IntStatus1"
 > UInt16    "unused0A_0E"[3] \-
 > UInt16    "U10_EP1Index"
 > UInt16    "U12_EP1RxMailbxData"
 > UInt16    "unused14_16"[2] \-
 > UInt16    "U18_EP2Index"
 > UInt16    "U1A_EP2TxMailbxData"
 > UInt16    "U1C_EP2IntPollIntvl"
 > UInt16    "unused1E"[1] \-
 > UInt16    "U20_EP3RxFIFOData"
 > UInt16    "U22_EP3RxFIFOCount"
 > UInt16    "U24_EP3RxFIFOStatus"
 > UInt16    "U26_EP3MaxPcktSize"
 > UInt16    "U28_EP4TxFIFOData"
 > UInt16    "U2A_EP4TxFIFOCount"
 > UInt16    "U2C_EP4TxFIFOStatus"
 > UInt16    "U2E_EP4MaxPcktSize"
 > UInt16    "U30_Revision"
 > UInt16    "U32_USBStatus"
 > UInt16    "U34_FrameCounterMSB"
 > UInt16    "U36_FrameCounterLSB"
 > UInt16    "U38_ExtRegisterIndx"
 > UInt16    "U3A_ExtRegisterData"
 > UInt16    "unused3C_3E"[2] \-
 > UInt16    "U40_FCInputControl"
 > UInt16    "U42_FCOutputStatus"
 > UInt16    "U44_PinIOStatusData"
 > UInt16    "U46_PosIntEnable"
 > UInt16    "U48_NegIntEnable"
 > UInt16    "U4A_PosIntStatus"
 > UInt16    "U4C_NegIntStatus"
 > UInt16    "U4E_PosIntMskStatus"
 > UInt16    "U50_NegIntMskStatus"
 > UInt16    "U52_SoftwareReset"
 > UInt16    "U54_WaitState"
typeend


alias "a3usb" "dm 08004000 Sed13A3UsbRegsType"
